package com.cloud.zhimao.common.config.exception;


import org.springframework.http.HttpStatus;

/**
 * @author Long
 */
public class Assert {
    public static void isTrue(boolean expression, String message) {
        if (!expression) {
            throw new CloudException(message);
        }
    }
    public static void isNull(Object object, String message) {
        if (object != null) {
            throw new CloudException(message, HttpStatus.NOT_FOUND);
        }
    }

    public static void notNull(Object object, String message) {
        if (object == null) {
            throw new CloudException(message, HttpStatus.NOT_FOUND);
        }
    }
}
